1. Field of the Invention
The invention is directed to a method for converting an object code for a source hardware into an equivalent program code according to a method for converting object cod for a source hardware into equivalent executable program code for a target hardware where the program code comprises a program part and a program part. In particular, the invention is directed to a method for converting an object code suitable for an earlier processor generation into a program code that is runnable on current hardware platforms.
2. Description of the Related Art
The increasing demands made on the performance capability of computer systems often require a switch to new computer generations, for example from CISC to RISC computers. Since, however, the programs existing for prior computer generations represent great economic value and can be necessary for the smooth execution of company-critical procedures, it is desirable or even indispensable to continue using the existing software base.
Manually rewriting of the programs onto the target hardware is very time-consuming and costly. Different techniques of automatic transformation have therefore been proposed.
When the existing programs or parts thereof are present in the source code of a standardized language, they can usually be converted onto the new target hardware by simple re-compiling. An automatic conversion is likewise possible for application programs that are present as assembler source code for the source hardware. Such a method, which, however, is not provided for the conversion of an object code, is disclosed in German Patent Application DE 196 17 842.
Often, however, user programs are only present in the form of an object code runnable on the source hardware. This is particularly the case for applications that have been modified over the course of years at the object code level. The original source code for such programs--if it is still available--is usually unusable since it does not contain the changes that have been made.
It is known to dynamically transform object code for a source hardware on the target hardware in the fashion of a command interpreter. Such an emulation of the source hardware, however, requires a great deal of computing time which cancel out the higher performance capability of the new hardware. Programs that usually run significantly faster on the target hardware can be produced with methods for static program transformation.
U.S. Pat. No. 5,313,614 discloses a method for static conversion of object code between computer systems having different hardware architectures. In the converted program, a complete image of the address space of the source machine is contained in the RAM of the target machine. This image, for example, contains an image repetition store and addresses for input/output registers. Memory accesses of the converted program occur in the corresponding addresses of the image. Accesses onto addresses that trigger a side affect in the source hardware are thereby intercepted and suitably converted.
This method is therefore provided for the conversion of object code that directly accesses the hardware of the source machine, but is relatively complicated precisely because of the support of hardware-related functions. This is true both with respect to the computing expenditure required for the conversion as well as the implementation of the converted program.
The article, "Binary Translation" by R. L. Sites et al. in the periodical Communications of the Association for Computing Machinery, Vol. 36, No. 2, February 1993, pages 69-81, shows a method for binary code conversion in which existing VAX and MIPS programs are converted into binary code for RISC computers. This method comprises converting an object code for a source hardware into an equivalent program code that comprises a program part and a data part, in which a code transformer analyzes each command of the object code for the source hardware and generates at least one corresponding entry from it into the program part of the program code, by which a part of the object code for the source hardware is accepted into the data part of the program code. It also incorporates all of the original object code (data and program part) into the generated binary code. In this method, machine code is generated for alpha-AXP processors in order to obtain an optimally direct imaging of the structures of the source hardware onto structures of the target hardware.
Converting existing CISC object code into optimized RISC code is known from the article, "Migrating a CISC Computer Family onto RISC via Object Code Translation" by K. Andrews et al. in ACM SIGPLAN Notices, Volume 27, No. 9, September 1992, pages 213-222.
The article, "A Methodology for Decompilation" by C. Cifuentes et al. in XIX Conferencia Latinoamericana de Informatica, Buenos Aires, Argentina, August 1993, pages 257-266, first mentions early work in the field of decompiling object code into high-level language source code, in which the authors proposed their own procedure for this decompiling. In this method, a high-level language program code is generated via a plurality of intermediate steps that comprises optimally far-reaching high-level language constructs. Correspondingly, memory accesses of the original object code are converted into global and local variables of the high-language program code.